﻿<?xml version="1.0" encoding="utf-8" ?>
<DbDataRequest connection="$ForumDBConnection$" type="$ForumDBType$">
  <SqlStatement hasResults="false">
    INSERT INTO ForumThreads(id,forumId,createdById,createdByName,title, threadImageUrl,totalPosts, dateCreated, lastPostById, lastPostByName, lastPostDate)
    VALUES(@id,@forumId,@createdById,@createdByName,@title,@threadImageUrl,@totalPosts,@dateCreated, @lastPostById, @lastPostByName, @dateCreated);
    UPDATE Forum SET numThread=numThread+1,lastPostTitle=@title,lastPostById=@createdById,lastPostByName=@createdByName WHERE id=@forumId;
  </SqlStatement>
  <Param name="id" type="UniqueIdentifier"/>
  <Param name="forumId" type="UniqueIdentifier"/>
  <Param name="createdBy.id" dbName="createdById" type="UniqueIdentifier"/>
  <Param name="createdBy.userName" dbName="createdByName" type="VarChar" />
  <Param name="title" type="VarChar"/>
  <Param name="threadImageUrl" type="varchar" />
  <Param name="totalPosts" type="Int" />
  <Param name="dateCreated" type="DateTime"/>
  <Param name="lastPostBy.id" dbName="lastPostById" type="UniqueIdentifier"/>
  <Param name="lastPostBy.userName" dbName="lastPostByName" type="VarChar" />
</DbDataRequest>